package com.gugee.ins.common.dal.service.blogger.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gugee.ins.common.dal.mapper.blogger.InsRelBloggerActiveFollowerMapper;
import com.gugee.ins.common.dal.service.blogger.InsRelBloggerActiveFollowerDao;
import com.gugee.ins.common.dto.RateData;
import com.gugee.ins.common.model.mysql.blogger.InsRelBloggerActiveFollower;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * InsRelBloggerActiveFollowerDaoImpl
 * @author Huangxin
 */
@Slf4j
@Service
public class InsRelBloggerActiveFollowerDaoImpl extends ServiceImpl<InsRelBloggerActiveFollowerMapper, InsRelBloggerActiveFollower>
        implements InsRelBloggerActiveFollowerDao {

    /**
     * 根据评论表信息批量插入
     * @param uid
     * @param insCommentCollectActiveFollowerCount
     * @return
     */
    @Override
    public void batchInsertByUid(long uid,int insCommentCollectActiveFollowerCount) {
        baseMapper.batchInsertByUid(uid,insCommentCollectActiveFollowerCount);
    }

    /**
     * 删除博主的活跃粉丝关系信息
     * @param uid
     */
    @Override
    public void deleteByUid(long uid) {
        Map<String,Object> deleteMap = new HashMap<>(1);
        deleteMap.put("uid",uid);
        baseMapper.deleteByMap(deleteMap);
    }

    @Override
    public int countByUidForAge(long uid) {
        return baseMapper.countByUidForAge(uid);
    }

    @Override
    public int countByUidForLanguage(long uid) {
        return baseMapper.countByUidForLanguage(uid);
    }

    @Override
    public int countByUidForNation(long uid) {
        return baseMapper.countByUidForNation(uid);
    }

    @Override
    public List<RateData> findActiveFollowerCategoryRateByUid(long uid, int limit) {
        return new ArrayList<>();
    }

    @Override
    public List<RateData> findActiveFollowerGroupByUid(long uid, int limit) {
        return new ArrayList<>();
    }

    @Override
    public long countAgeRangeByUid(long uid, Integer beginAge, Integer endAge) {
        return baseMapper.countAgeRangeByUid(uid,beginAge,endAge);
    }

    @Override
    public long countGenderByUid(long uid, Integer gender,Integer beginAge,Integer endAge) {
        return baseMapper.countGenderByUid(uid,gender,beginAge,endAge);
    }
}
